<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    instanceof: 判断某个实例，是不是属于哪个类
    <script>
         var arr=[1,2,3];
         console.log(arr);
        // console.log(arr instanceof Array);//true
        // console.log(arr instanceof Object);//true

        // function Array(){
        //     [native code]
        // }
        // let arr =new Array()

        //自己构造类
        function Fn(name,age){
           this.name=name;//私有属性
           this.age=age;
           this.say=function(){}//私有方法
        }

        Fn.prototype.show=function(){//公有的方法
            console.log("111")
        }
        Fn.prototype.num=100;//公有属性

        let f1=new Fn("lili",18);

        console.log(f1);

        console.log(f1 instanceof Array);
        console.log(f1 instanceof Fn);
        console.log(f1 instanceof Object);
    </script>
</body>
</html>